﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using lib = LibUpdate;
namespace updateme
{
    class Update
    {
      

        public void  comd_str(string[] args)
        {
          foreach (string str in args)
            {
                if ("UPDATE" == str.ToUpper())
                {
                    lib.UpdateConfig uConfig = new LibUpdate.UpdateConfig();
                    uConfig.ApplictionPath = Application.StartupPath;
                    uConfig.ServerPath = lib.UpdateVerXML.XMLtoBase(Application.StartupPath + "\\clientversion.xml");
                    //是修改升级程序
                    lib.UpdateControl con = new LibUpdate.UpdateControl(uConfig);
                    con.Update_ver=lib.UpdateVerXML.XMLtoVersion(Application.StartupPath + "\\clientversion.xml");
                   
                    con.UpdateActionVer();

                    if (System.IO.File.Exists(Application.StartupPath + "\\Update.exe"))
                    {
                        System.Diagnostics.Process p = new System.Diagnostics.Process();
                        p.StartInfo = new System.Diagnostics.ProcessStartInfo(Application.StartupPath + "\\Update.exe", "update");
                        p.Start();
                    }

             
                }
            }
        }
    }
}
